1. Field of the Invention
The present invention relates to a technique for assisting an operator in selecting a pattern element(s) out of pattern elements in a reference image, as a reference pattern element(s) used for detection of a position of a target image relative to a reference image by pattern matching.
2. Description of the Background Art
Conventionally, detection of a position of a target image relative to a reference image has been accomplished by pattern matching. For the detection, a pattern element is designated as a reference pattern element for pattern matching by an operator. For example, in testing a pattern formed on a printed wiring board, a semiconductor substrate, a glass substrate, or the like (which will be hereinafter referred to as a “substrate”), a non-defective substrate on which the same pattern as the pattern on the substrate being tested is formed is prepared, and an image of a region including a desired portion in the pattern formed on the non-defective substrate is previously captured to provide a color reference image. Subsequently, the color reference image is binarized, and a pattern element found in the desired portion in a resultant binary color reference image is designated as a reference pattern element by an operator. Then, a position of a target image which is obtained by capturing an image of the substrate being tested, relative to the reference image, is detected by pattern matching using the pattern element designated as the reference pattern element. As a result, a device for capturing the image of the substrate is accurately located in a desired position above the substrate (in other words, a device for capturing the image of the substrate is appropriately aligned to the substrate), and a test on the pattern on the substrate is carried out.
According to a method disclosed in Japanese Patent Application Laid-Open No. 5-6421 (which will be hereinafter referred to as “JP No. 5-6421”), a plurality of membership functions respectively corresponding to a plurality of values representing geometric features of various model pattern elements are prepared, and a degree of conformity of each of a plurality of pattern elements in a binary target image to each of the model pattern elements (in other words, a degree to which each of a plurality of pattern elements in a binary target image agrees with each of the model pattern elements, which will be hereinafter referred to as a “conformity degree”) is determined by substituting the values representing geometric features into the membership functions. Then, the resultant conformity degrees are compared with one another for each of the plurality of pattern elements, to identify a category of any of the model pattern elements to which the pattern element belongs.
When the target image includes other pattern elements which are similar to the pattern element designated as the reference pattern element, the position of the target image relative to the reference image cannot be accurately detected in pattern matching due to misrecognition of the reference pattern element in some cases. One solution to prevent misrecognition of the reference pattern element is to have the operator confirm whether or not a pattern element possibly causing misrecognition is present around the pattern element designated as the reference pattern element in the reference image. However, it is not easy to determine whether or not one pattern element is supposed to actually cause misrecognition, and thus the foregoing solution requires complicated tasks on the part of the operator.